<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    {if condition="$user_id"}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">开通会员:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" name="row[user_id]" type="hidden" value="{$user_id}">
            <div style="margin-top: 6px">{$user['nickname']}</div>
        </div>
    </div>
    {else/}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="">
        </div>
    </div>
    {/if}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{if condition="$agent"}代理等级{else/}{:__('VIP')}{/if}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-vip_id" data-rule="required" data-source="vip/vip/index?agent={$agent}" class="form-control selectpage" name="row[vip_id]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Days')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-days" class="form-control" name="row[days]" type="number" value="0">
        </div>
    </div>
    <div class="form-group" {if condition="$agent"}style="display: none"{/if}>
        <label class="control-label col-xs-12 col-sm-2">{:__('Amount')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-amount" class="form-control" step="0.01" name="row[amount]" type="number" value="0.00">
        </div>
    </div>
    <div class="form-group" {if condition="$agent"}style="display: none"{/if}>
        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="radio">
            {php}$statusList = ['created'=>'未支付', 'active'=>'生效中']; $checked = $agent ? 'active' : 'created';{/php}
            {foreach name="statusList" item="vo"}
            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {if condition="$key == $checked"}checked{/if} /> {$vo}</label>
            {/foreach}
            </div>

        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <input name="row[agent]" type="hidden" value="{$agent}">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
